package com.ulook.lookplanet.data.repository;

import com.ulook.lookplanet.data.source.HomeDataSource;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/3/26
 */
public class HomeRepository {

    private static volatile HomeRepository instance;

    private HomeDataSource dataSource;

    private HomeRepository(HomeDataSource dataSource){
        this.dataSource = dataSource;
    }

    public static HomeRepository getInstance(HomeDataSource dataSource){
        if(instance == null){
            instance = new HomeRepository(dataSource);
        }
        return instance;
    }

    /**
     * 初始化页面展示的信息
     * @param userId
     */
    public void initUserInfo(int userId, ResponseCallback callback){
        dataSource.initUserInfo(userId, callback);
    }

}
